package hmvictor.jpql.types;

import java.util.Calendar;
import javax.persistence.Parameter;
import javax.persistence.Query;
import javax.persistence.TemporalType;

/**
 *
 * @author Victor
 */
public class CalendarTemporalDate extends  AbstractParameterType<Calendar>{

    public CalendarTemporalDate() {
        super("Calendar (Date)");
    }

    @Override
    public Editor<Calendar> createEditor() {
        return new DateCalendarEditor();
    }

    @Override
    public void setParameter(Query query, Parameter parameter, Calendar value) {
        query.setParameter(parameter, value, TemporalType.DATE);
    }

}
